<?php

namespace api\modules\manage\components;

use api\common\helpers\Constant;
use api\modules\manage\services\MenuService;
use Yii;

class Transfer
{
    public static function push2RightQueue()
    {
        $params = [
            'state' => 1,
            'parent_id' => 0
        ];
        $service = Yii::createObject(['class' => MenuService::className(), 'params' => $params]);
        $menus = $service->circlePushData();
        $redis = Yii::$app->redis;
        $key = Constant::RIGHT_QUEUE;
        $res = $redis->lpush($key, json_encode($menus));
//        \Yii::error('推送权限队列数据：' . json_encode($menus));
    }

    public static function push2StepQueue($uniqueId)
    {
        $redis = Yii::$app->redis;
        $key = Constant::STEP_UNIQUE;
        $res = $redis->lpush($key, $uniqueId);
    }

    public static function push2EventInfoQueue($eventId)
    {
        $redis = Yii::$app->redis;
        $key = Constant::EVENT_INFO_UNIQUE;
        $res = $redis->lpush($key, $eventId);
    }
}